<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
	
	<!-- Jquery -->
	
	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/> <!-- Droids Font -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	
	
	<!-- javascript para controlar el mapa y markers -->
	<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/mapscripts.js" type="text/javascript"></script>
	<!-- lightbox -->
	<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.js" type="text/javascript"></script>
	<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.lightbox-0.5.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.lightbox-0.5.css" />
	
	
	<script type="text/javascript">
	$(document).ready(ini);

	function ini()
	{
		//alert("ini")
		$('.galeria a').lightBox(); // Select all links in the page;
	}

	</script>
	
	<script type="text/javascript">
	if (window.location.hash.length > 0) window.location = GetSiteRoot() + 'index.php/list/singleHouse/' + window.location.hash.substring(1);
	</script>
	
	
	
	<script src="//maps.google.com/maps?file=api&amp;v=2.x&amp;key=AIzaSyApJnoh9nfeqd5UTRUVEDmEyfGTvVLrAnc" type="text/javascript"></script>
	
	
	
    <script type="text/javascript">
	
    var map = null;
    var geocoder = null;
    var my_data;
    var markers = new Array();
    
    
    function initialize() {
    	  	
    	if (GBrowserIsCompatible()) {
           	createMapNGeocoder();
			
           	$("#chk_alquiler").change(refreshIcons);
           	$("#chk_venta").change(refreshIcons);
           	$("#chk_remate").change(refreshIcons);
           	  
    		//TEST - Mostrar una propiedad en el mapa
            //var my_lat = <?php //echo CJSON::encode($lat);?>; // number
            //var my_long = <?php //echo CJSON::encode($long);?>; // number
            
            //parsear el array principal de propiedades
            //var my_data = <?php echo CJSON::encode($this->propiedades);?>; // array props - number
            my_data = <?php echo CJSON::encode($this->arrayProp);?>; // array props - number
            favo = <?php echo CJSON::encode($this->favoritas);?>; // array props - number
    		//carga un marcador para cada propiedad
    		for(x in my_data){
    			createMarker(my_data[x].lat, my_data[x].lng, my_data[x].descripcion_breve, my_data[x].id, my_data[x].tipoPropiedad, my_data[x].pubs);
    		}  
          }        
    }
    </script>
	
	
	
	<!-- javascript para controlar el estilo del mapa y la info detallada -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/mapregion.css" />
	
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body onload="initialize()" onunload="GUnload()">

<div class="container" id="page">

	<div id="header">
		<div id="logo"></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Mapa', 'url'=>array('/site/index')),
				//array('label'=>'Alquiler', 'url'=>array('/rent/index')),
				//array('label'=>'Venta', 'url'=>array('/sales/index')),
				array('label'=>'Listado', 'url'=>array('/list/index')),
				array('label'=>'Favoritos', 'url'=>array('/favoritos/index'), 'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Contacto', 'url'=>array('/site/contact')),
				array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("Login"), 'visible'=>Yii::app()->user->isGuest),
				array('url'=>Yii::app()->getModule('user')->registrationUrl, 'label'=>Yii::app()->getModule('user')->t("Register"), 'visible'=>Yii::app()->user->isGuest),
				//array('url'=>Yii::app()->getModule('user')->profileUrl, 'label'=>Yii::app()->getModule('user')->t("Profile"), 'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Mantenimiento', 'url'=>array('site/maintenance'), 'visible'=>Yii::app()->getModule('user')->isAdmin()),
				array('url'=>Yii::app()->getModule('user')->logoutUrl, 'label'=>Yii::app()->getModule('user')->t("Logout").' ('.Yii::app()->user->name.')', 'visible'=>!Yii::app()->user->isGuest),
			),
		)); ?>
		
		
		
		
		
		
	</div><!-- mainmenu -->
	
	<?php $this->widget('application.extensions.social.social', array(
	    	'style'=>'horizontal', 
	        'networks' => array(
	        'twitter'=>array(
	            'data-via'=>'', //http://twitter.com/#!/YourPageAccount if exists else leave empty
	            ), 
	        'googleplusone'=>array(
	            "size"=>"medium",
	            "annotation"=>"bubble",
	        ), 
	        'facebook'=>array(
	            'href'=>'http://localhost/uytecho/',//asociate your page http://www.facebook.com/page 
	            'action'=>'like',//recommend, like
	            'colorscheme'=>'light',
	            'width'=>'120px',
	            )
	        )
		)); ?>	
	
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>

	<?php echo $content; ?>

	<div class="clear"></div><!-- clearfix -->
	
	<div id="footer">
	
		<?php echo CHtml::link('Contacto', array('site/contact'));?><br/>
		<?php echo CHtml::link('Acerca de Nosotros', array('site/page', 'view'=>'about'));?><br/>
	    <br/>
	    <br/>
    	Copyright &copy; <?php echo date('Y'); ?> by Studioos<br/>
			All Rights Reserved.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>
